package lanqiaotrain.t2;

import java.util.Scanner;

/**
 * @Author: Hasee
 * @Date: 2020-07-23 18:24:34
 */
public class Basic4 {
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        int n=scanner.nextInt();
        int[] num=new int[n];

        for (int i=0;i<n;i++){
            num[i]=scanner.nextInt();
        }
        int max=num[0];
        int min=num[0];
        int sum=0;
        for (int k:num) {
            if (k>max){
                max=k;
            }
            if (k<min){
                min=k;
            }
            sum+=k;
        }
        System.out.println(max);
        System.out.println(min);
        System.out.println(sum);
    }
}
